<div class="refentry" lang="en" xml:lang="en"><a id="glRenderMode"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>glRenderMode — set rasterization mode</p></div><div class="refsynopsisdiv"><h2>C Specification</h2><div class="funcsynopsis"><table><tr><td><code class="funcdef">GLint <b class="fsfunc">glRenderMode</b>(</code></td><td>GLenum  </td><td><var class="pdparam">mode</var><code>)</code>;</td></tr></table></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="parameters"></a><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>mode</code></em></span></dt><dd><p>
                    Specifies the rasterization mode.
                    Three values are accepted:
                    <code class="constant">GL_RENDER</code>,
                    <code class="constant">GL_SELECT</code>, and
                    <code class="constant">GL_FEEDBACK</code>.
                    The initial value is <code class="constant">GL_RENDER</code>.
                </p></dd></dl></div></div><div class="refsect1" lang="en" xml:lang="en"><a id="description"></a><h2>Description</h2><p>
            <code class="function">glRenderMode</code> sets the rasterization mode.
            It takes one argument,
            <em class="parameter"><code>mode</code></em>,
            which can assume one of three predefined values:
        </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_RENDER</code></span></dt><dd><p>
                        Render mode. Primitives are rasterized,
                        producing pixel fragments,
                        which are written into the frame buffer.
                        This is the normal mode
                        and also the default mode.
                    </p></dd><dt><span class="term"><code class="constant">GL_SELECT</code></span></dt><dd><p>
                        Selection mode.
                        No pixel fragments are produced,
                        and no change to the frame buffer contents is made.
                        Instead,
                        a record of the names of primitives that would have been drawn
                        if the render mode had been <code class="constant">GL_RENDER</code> is returned in a select buffer,
                        which must be created (see <a class="citerefentry" href="glSelectBuffer"><span class="citerefentry"><span class="refentrytitle">glSelectBuffer</span></span></a>) before selection mode
                        is entered.
                    </p></dd><dt><span class="term"><code class="constant">GL_FEEDBACK</code></span></dt><dd><p>
                        Feedback mode.
                        No pixel fragments are produced,
                        and no change to the frame buffer contents is made.
                        Instead,
                        the coordinates and attributes of vertices that would have been drawn
                        if the render mode had been <code class="constant">GL_RENDER</code> is returned in a feedback buffer,
                        which must be created (see <a class="citerefentry" href="glFeedbackBuffer"><span class="citerefentry"><span class="refentrytitle">glFeedbackBuffer</span></span></a>) before feedback mode
                        is entered.
                    </p></dd></dl></div><p>
            The return value of <code class="function">glRenderMode</code> is determined by the render mode at the time
            <code class="function">glRenderMode</code> is called,
            rather than by <em class="parameter"><code>mode</code></em>.
            The values returned for the three render modes are as follows:
        </p><div class="variablelist"><dl><dt><span class="term"><code class="constant">GL_RENDER</code></span></dt><dd><p>
                        0.
                    </p></dd><dt><span class="term"><code class="constant">GL_SELECT</code></span></dt><dd><p>
                        The number of hit records transferred to the select buffer.
                    </p></dd><dt><span class="term"><code class="constant">GL_FEEDBACK</code></span></dt><dd><p>
                        The number of values (not vertices) transferred to the feedback buffer.
                    </p></dd></dl></div><p>
            See the <a class="citerefentry" href="glSelectBuffer"><span class="citerefentry"><span class="refentrytitle">glSelectBuffer</span></span></a> and <a class="citerefentry" href="glFeedbackBuffer"><span class="citerefentry"><span class="refentrytitle">glFeedbackBuffer</span></span></a> reference pages for
            more details concerning selection and feedback operation.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="notes"></a><h2>Notes</h2><p>
            If an error is generated,
            <code class="function">glRenderMode</code> returns 0 regardless of the current render mode.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="errors"></a><h2>Errors</h2><p>
            <code class="constant">GL_INVALID_ENUM</code> is generated if <em class="parameter"><code>mode</code></em> is not one of the three
            accepted values.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if <a class="citerefentry" href="glSelectBuffer"><span class="citerefentry"><span class="refentrytitle">glSelectBuffer</span></span></a> is called
            while the render mode is <code class="constant">GL_SELECT</code>,
            or if <code class="function">glRenderMode</code> is called with argument <code class="constant">GL_SELECT</code> before
            <a class="citerefentry" href="glSelectBuffer"><span class="citerefentry"><span class="refentrytitle">glSelectBuffer</span></span></a> is called at least once.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if <a class="citerefentry" href="glFeedbackBuffer"><span class="citerefentry"><span class="refentrytitle">glFeedbackBuffer</span></span></a> is called
            while the render mode is <code class="constant">GL_FEEDBACK</code>,
            or if <code class="function">glRenderMode</code> is called with argument <code class="constant">GL_FEEDBACK</code> before
            <a class="citerefentry" href="glFeedbackBuffer"><span class="citerefentry"><span class="refentrytitle">glFeedbackBuffer</span></span></a> is called at least once.
        </p><p>
            <code class="constant">GL_INVALID_OPERATION</code> is generated if <code class="function">glRenderMode</code>
            is executed between the execution of <a class="citerefentry" href="glBegin"><span class="citerefentry"><span class="refentrytitle">glBegin</span></span></a>
            and the corresponding execution of <a class="citerefentry" href="glEnd"><span class="citerefentry"><span class="refentrytitle">glEnd</span></span></a>.
        </p></div><div class="refsect1" lang="en" xml:lang="en"><a id="associatedgets"></a><h2>Associated Gets</h2><p>
            <a class="citerefentry" href="glGet"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_RENDER_MODE</code>
        </p></div>
        {$pipelinestall}{$examples}
        <div class="refsect1" lang="en" xml:lang="en"><a id="seealso"></a><h2>See Also</h2><p>
            <a class="citerefentry" href="glFeedbackBuffer"><span class="citerefentry"><span class="refentrytitle">glFeedbackBuffer</span></span></a>,
            <a class="citerefentry" href="glInitNames"><span class="citerefentry"><span class="refentrytitle">glInitNames</span></span></a>,
            <a class="citerefentry" href="glLoadName"><span class="citerefentry"><span class="refentrytitle">glLoadName</span></span></a>,
            <a class="citerefentry" href="glPassThrough"><span class="citerefentry"><span class="refentrytitle">glPassThrough</span></span></a>,
            <a class="citerefentry" href="glPushName"><span class="citerefentry"><span class="refentrytitle">glPushName</span></span></a>,
            <a class="citerefentry" href="glSelectBuffer"><span class="citerefentry"><span class="refentrytitle">glSelectBuffer</span></span></a>
        </p></div><div class="refsect1" lang="en" xml:lang="en"><div id="Copyright"><h2>Copyright</h2><p>
            Copyright © 1991-2006
            Silicon Graphics, Inc. This document is licensed under the SGI
            Free Software B License. For details, see
            <a class="ulink" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
        </p></div></div></div>
